package com.sky.controller.user;

import com.sky.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.*;

@Api(tags = "用户端-店铺状态管理相关接口")
@RestController
@RequestMapping("/user/shop")
@Slf4j
public class ShopUserController {
    /** 店铺状态 0 打烊 1 营业 */
    public static final String SHOP_STATUS = "SHOP_STATUS";
    @Autowired
    RedisTemplate redisTemplate;

    /**
     * 获取店铺的营业状态
     * @return
     */
    @ApiOperation("用户端-获取店铺营业状态")
    @GetMapping("/status")
    public Result getStatus(){
        return Result.success(redisTemplate.opsForValue().get(SHOP_STATUS));
    }

}
